VERSION 5.00
Object = "{00025600-0000-0000-C000-000000000046}#5.2#0"; "crystl32.ocx"
Begin VB.MDIForm FrmMainMenu 
   Appearance      =   0  'Flat
   BackColor       =   &H00FFFFFF&
   Caption         =   "BML V1.03"
   ClientHeight    =   7455
   ClientLeft      =   1095
   ClientTop       =   1380
   ClientWidth     =   10545
   LinkTopic       =   "MDIForm1"
   Picture         =   "frmMenu.frx":0000
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin Crystal.CrystalReport CrystalReport1 
      Left            =   4560
      Top             =   1080
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   348160
      PrintFileLinesPerPage=   60
   End
   Begin VB.PictureBox Picture1 
      Align           =   1  'Align Top
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   0
      ScaleHeight     =   315
      ScaleWidth      =   10545
      TabIndex        =   0
      Top             =   0
      Width           =   10545
      Begin VB.Label lblNote 
         BackStyle       =   0  'Transparent
         Caption         =   "Please wait loading Menu . . ."
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   270
         Left            =   270
         TabIndex        =   1
         Top             =   60
         Width           =   4380
      End
   End
   Begin VB.Menu mn 
      Caption         =   "&Inventory"
      Index           =   1
      Begin VB.Menu i 
         Caption         =   "&a. Maintenance"
         Index           =   1
         Begin VB.Menu i1 
            Caption         =   "&1. Item Master"
            Index           =   1
         End
         Begin VB.Menu i1 
            Caption         =   "&2. Warehouse Master"
            Index           =   2
         End
         Begin VB.Menu i1 
            Caption         =   "&3. Lot Master"
            Index           =   3
         End
         Begin VB.Menu i1 
            Caption         =   "&4. Item Type"
            Index           =   4
         End
         Begin VB.Menu i1 
            Caption         =   "&5. Item Class"
            Index           =   5
         End
         Begin VB.Menu i1 
            Caption         =   "&6. Unit Of Measurement"
            Index           =   6
         End
         Begin VB.Menu i1 
            Caption         =   "&7. Transaction Effect Code"
            Index           =   7
         End
      End
      Begin VB.Menu i 
         Caption         =   "&b. List"
         Index           =   2
         Begin VB.Menu i2 
            Caption         =   "&1. Item Master "
            Index           =   1
         End
         Begin VB.Menu i2 
            Caption         =   "&2. Warehouse Master"
            Index           =   2
         End
         Begin VB.Menu i2 
            Caption         =   "&3. Lot Master"
            Index           =   3
         End
         Begin VB.Menu i2 
            Caption         =   "&4. Item Type"
            Index           =   4
         End
         Begin VB.Menu i2 
            Caption         =   "&5. Item Class"
            Index           =   5
         End
         Begin VB.Menu i2 
            Caption         =   "&6. Unit Of Measurement"
            Index           =   6
         End
         Begin VB.Menu i2 
            Caption         =   "&7. Transaction Effect Code"
            Index           =   7
         End
      End
      Begin VB.Menu i 
         Caption         =   "&c. Report"
         Index           =   3
         Begin VB.Menu i3 
            Caption         =   "&1. Inventory Report"
            Index           =   1
         End
         Begin VB.Menu i3 
            Caption         =   "&2. Received Report"
            Index           =   2
         End
         Begin VB.Menu i3 
            Caption         =   "&3. Issued Report"
            Index           =   3
         End
         Begin VB.Menu i3 
            Caption         =   "&4. Stock Moment Report"
            Index           =   4
         End
      End
      Begin VB.Menu i 
         Caption         =   "&d. Inquiry"
         Index           =   4
         Begin VB.Menu i4 
            Caption         =   "&1. Inventory Status"
            Index           =   1
         End
      End
      Begin VB.Menu i 
         Caption         =   "&e. Entry"
         Index           =   5
         Begin VB.Menu i5 
            Caption         =   "&1. Inventorry Transaction"
            Index           =   1
         End
         Begin VB.Menu i5 
            Caption         =   "&2. Inventory Count Tag"
            Index           =   2
         End
         Begin VB.Menu i5 
            Caption         =   "&3. Automatic Recieved"
            Index           =   3
         End
      End
      Begin VB.Menu i 
         Caption         =   "&f. End Closing"
         Index           =   6
         Begin VB.Menu i6 
            Caption         =   "&1. Period End Closing"
            Index           =   1
         End
         Begin VB.Menu i6 
            Caption         =   "&2. Year End Closing"
            Index           =   2
         End
      End
      Begin VB.Menu i 
         Caption         =   "&g. Inventory Record Purge"
         Index           =   7
      End
   End
   Begin VB.Menu mn 
      Caption         =   "&Account Receive"
      Index           =   2
      Begin VB.Menu a 
         Caption         =   "&a. Maintenance"
         Index           =   1
         Begin VB.Menu a1 
            Caption         =   "&1. Customer Master"
            Index           =   1
         End
         Begin VB.Menu a1 
            Caption         =   "&2. Customer Type"
            Index           =   2
         End
      End
      Begin VB.Menu a 
         Caption         =   "&b. List"
         Index           =   2
         Begin VB.Menu a2 
            Caption         =   "&1. Customer Master"
            Index           =   1
         End
         Begin VB.Menu a2 
            Caption         =   "&2. Customer Type"
            Index           =   2
         End
      End
      Begin VB.Menu a 
         Caption         =   "&c. Report"
         Index           =   3
         Begin VB.Menu a3 
            Caption         =   "&1. Account Recieve Aging Detail"
            Index           =   1
         End
         Begin VB.Menu a3 
            Caption         =   "&2. Account Recieve Aging Sumary"
            Index           =   2
         End
         Begin VB.Menu a3 
            Caption         =   "&3. Daily Collection Due Report"
            Index           =   3
         End
      End
      Begin VB.Menu a 
         Caption         =   "&d. Entry"
         Index           =   4
         Begin VB.Menu a4 
            Caption         =   "&1. Account Recieve Posting"
            Index           =   1
         End
         Begin VB.Menu a4 
            Caption         =   "&2. Account Recieve G/L Posting"
            Index           =   2
         End
      End
      Begin VB.Menu a 
         Caption         =   "&e. Acount Recieve Inquiry"
         Index           =   5
      End
      Begin VB.Menu a 
         Caption         =   "&f. Account Recieve Records Purges"
         Index           =   6
      End
   End
   Begin VB.Menu mn 
      Caption         =   "&Purchase Order"
      Index           =   3
      Begin VB.Menu p 
         Caption         =   "&1. Purchase Contract Price Mainternance"
         Index           =   1
      End
      Begin VB.Menu p 
         Caption         =   "&2. Purchase Contract Price List"
         Index           =   2
      End
      Begin VB.Menu p 
         Caption         =   "&3. Open Purchase Order List by Order"
         Index           =   3
      End
      Begin VB.Menu p 
         Caption         =   "&4. Open Purchase Order List by Item"
         Index           =   4
      End
      Begin VB.Menu p 
         Caption         =   "&5. Purchase Order"
         Index           =   5
      End
      Begin VB.Menu p 
         Caption         =   "&6. Purchase Order Confirm"
         Index           =   6
      End
      Begin VB.Menu p 
         Caption         =   "&7. Report"
         Index           =   7
         Begin VB.Menu p1 
            Caption         =   "&1. Report by Order No"
            Index           =   1
         End
         Begin VB.Menu p1 
            Caption         =   "&2. Report by Item"
            Index           =   2
         End
         Begin VB.Menu p1 
            Caption         =   "&3. Report by Custumer"
            Index           =   3
         End
      End
   End
   Begin VB.Menu mn 
      Caption         =   "&Order"
      Index           =   4
      Begin VB.Menu o 
         Caption         =   "&a. Maintenance"
         Index           =   1
         Begin VB.Menu o1 
            Caption         =   "&1. List Price"
            Index           =   1
         End
         Begin VB.Menu o1 
            Caption         =   "&2. Type Of Payment"
            Index           =   2
         End
         Begin VB.Menu o1 
            Caption         =   "&3. Ship to"
            Index           =   3
         End
         Begin VB.Menu o1 
            Caption         =   "&4. Payment Term Master"
            Index           =   4
         End
      End
      Begin VB.Menu o 
         Caption         =   "&b. List"
         Index           =   2
         Begin VB.Menu o2 
            Caption         =   "&1. List Price"
            Index           =   1
         End
         Begin VB.Menu o2 
            Caption         =   "&2. Payment term"
            Index           =   2
         End
         Begin VB.Menu o2 
            Caption         =   "&3. Ship to"
            Index           =   3
         End
         Begin VB.Menu o2 
            Caption         =   "&4. Payment Term Master"
            Index           =   4
         End
      End
      Begin VB.Menu o 
         Caption         =   "&c. Report"
         Index           =   3
         Begin VB.Menu o3 
            Caption         =   "&1. Open Order Report by Order Number"
            Index           =   1
         End
         Begin VB.Menu o3 
            Caption         =   "&2. Open Order Report by Customer"
            Index           =   2
         End
         Begin VB.Menu o3 
            Caption         =   "&3. Open Order Report by Product Item"
            Index           =   3
         End
         Begin VB.Menu o3 
            Caption         =   "&4. Order Back order Report"
            Index           =   4
         End
         Begin VB.Menu o3 
            Caption         =   "&5. Order Credit Hold Report"
            Index           =   5
         End
      End
      Begin VB.Menu o 
         Caption         =   "&d. Order Inquiry"
         Index           =   4
      End
      Begin VB.Menu o 
         Caption         =   "&e. Order Entry"
         Index           =   5
      End
      Begin VB.Menu o 
         Caption         =   "&f. Order Credit Release"
         Index           =   6
      End
      Begin VB.Menu o 
         Caption         =   "&g. Order Packing,Confirmation"
         Index           =   7
      End
      Begin VB.Menu o 
         Caption         =   "&h. Order Reord Purges"
         Index           =   8
      End
      Begin VB.Menu o 
         Caption         =   "&k. Preinvoice Maintenance"
         Index           =   9
      End
      Begin VB.Menu o 
         Caption         =   "&L. Order submit"
         Index           =   10
      End
   End
   Begin VB.Menu mn 
      Caption         =   "&Invoice"
      Index           =   5
      Begin VB.Menu iv 
         Caption         =   "&1. Invoice Printting"
         Index           =   1
      End
      Begin VB.Menu iv 
         Caption         =   "&2. Invoice Re_Printing"
         Index           =   2
      End
      Begin VB.Menu iv 
         Caption         =   "&3. Daily Invoice Report"
         Index           =   3
      End
      Begin VB.Menu iv 
         Caption         =   "&4. Monthly Invoice Report"
         Index           =   4
      End
      Begin VB.Menu iv 
         Caption         =   "&5. Invoice Entry"
         Index           =   5
      End
      Begin VB.Menu iv 
         Caption         =   "&6. Convert Invoice from Packing Order"
         Index           =   6
      End
      Begin VB.Menu iv 
         Caption         =   "&7. Invoice Registration"
         Index           =   7
      End
   End
   Begin VB.Menu mn 
      Caption         =   "Sa&le"
      Index           =   6
      Begin VB.Menu l 
         Caption         =   "&a. Salesman Master"
         Index           =   1
      End
      Begin VB.Menu l 
         Caption         =   "&b. Sales Report"
         Index           =   2
         Begin VB.Menu l2 
            Caption         =   "&1. Sales Report by Product"
            Index           =   1
         End
         Begin VB.Menu l2 
            Caption         =   "&2. Sales Report by Customers"
            Index           =   2
         End
         Begin VB.Menu l2 
            Caption         =   "&3. Sales Report by Salesman"
            Index           =   3
         End
      End
      Begin VB.Menu l 
         Caption         =   "&c. Sales Inquiry"
         Index           =   3
      End
      Begin VB.Menu l 
         Caption         =   "&d. Daily Sales Updating"
         Index           =   4
      End
   End
   Begin VB.Menu mn 
      Caption         =   "Account Pa&yable"
      Index           =   7
      Begin VB.Menu y 
         Caption         =   "&a. Vendor Master Maintenance"
         Index           =   1
      End
      Begin VB.Menu y 
         Caption         =   "&b. Vendor Master List"
         Index           =   2
      End
      Begin VB.Menu y 
         Caption         =   "&c. Report"
         Index           =   3
         Begin VB.Menu y3 
            Caption         =   "&1. Account Payable Aging Report"
            Index           =   1
         End
         Begin VB.Menu y3 
            Caption         =   "&2. Payment Schedule Report"
            Index           =   2
         End
         Begin VB.Menu y3 
            Caption         =   "&3. Cash Requirement Report"
            Index           =   3
         End
      End
      Begin VB.Menu y 
         Caption         =   "&d. Account Payable  Transction Posting"
         Index           =   4
      End
      Begin VB.Menu y 
         Caption         =   "&e. Account Payable G/L Transaction Posting"
         Index           =   5
      End
      Begin VB.Menu y 
         Caption         =   "&f. Account Payable "
         Index           =   6
      End
      Begin VB.Menu y 
         Caption         =   "&g. Account Payable Records purges"
         Index           =   7
      End
   End
   Begin VB.Menu mn 
      Caption         =   "&General Ledger"
      Index           =   8
      Begin VB.Menu g 
         Caption         =   "&a. Maintenance"
         Index           =   1
         Begin VB.Menu g1 
            Caption         =   "&1. Company Master"
            Index           =   1
         End
         Begin VB.Menu g1 
            Caption         =   "&2. Profit Master"
            Index           =   2
         End
         Begin VB.Menu g1 
            Caption         =   "&3. Chart Account"
            Index           =   3
         End
         Begin VB.Menu g1 
            Caption         =   "&4. General Ledger mater"
            Index           =   4
         End
         Begin VB.Menu g1 
            Caption         =   "&5. Period Mater"
            Index           =   5
         End
         Begin VB.Menu g1 
            Caption         =   "&6. Currency Code"
            Index           =   6
         End
         Begin VB.Menu g1 
            Caption         =   "&7. Rate Exchange"
            Index           =   7
         End
      End
      Begin VB.Menu g 
         Caption         =   "&b. List"
         Index           =   2
         Begin VB.Menu g2 
            Caption         =   "&1. Company Master"
            Index           =   1
         End
         Begin VB.Menu g2 
            Caption         =   "&2. Profit Master"
            Index           =   2
         End
         Begin VB.Menu g2 
            Caption         =   "&3. Chart Account"
            Index           =   3
         End
         Begin VB.Menu g2 
            Caption         =   "&4. General Ledger mater"
            Index           =   4
         End
         Begin VB.Menu g2 
            Caption         =   "&5. Period Mater"
            Index           =   5
         End
         Begin VB.Menu g2 
            Caption         =   "&6. Currency Code"
            Index           =   6
         End
         Begin VB.Menu g2 
            Caption         =   "&7. Rate Exchange"
            Index           =   7
         End
      End
      Begin VB.Menu g 
         Caption         =   "&c. Report"
         Index           =   3
         Begin VB.Menu g3 
            Caption         =   "&1. G/L Balance Sheet Report"
            Index           =   1
         End
         Begin VB.Menu g3 
            Caption         =   "&2. G/L Outstanding Report"
            Index           =   2
         End
         Begin VB.Menu g3 
            Caption         =   "&3. G/L Expenses Report"
            Index           =   3
         End
         Begin VB.Menu g3 
            Caption         =   "&4. G/L Profit And Loss Report"
            Index           =   4
         End
      End
      Begin VB.Menu g 
         Caption         =   "&d. Entry"
         Index           =   4
         Begin VB.Menu g4 
            Caption         =   "&1. Journal Entry Edit list"
            Index           =   1
         End
         Begin VB.Menu g4 
            Caption         =   "&2. G/L Journal Entry"
            Index           =   2
         End
      End
      Begin VB.Menu g 
         Caption         =   "&e. Post"
         Index           =   5
         Begin VB.Menu g5 
            Caption         =   "&1. Journal Auto Post Edit List"
            Index           =   1
         End
         Begin VB.Menu g5 
            Caption         =   "&2. G/L Journal  Post"
            Index           =   2
         End
      End
      Begin VB.Menu g 
         Caption         =   "&f. Closing"
         Index           =   6
         Begin VB.Menu g6 
            Caption         =   "&1. G/L Period Closing"
            Index           =   1
         End
         Begin VB.Menu g6 
            Caption         =   "&2. G/L Year End Closing"
            Index           =   2
         End
      End
   End
   Begin VB.Menu mn 
      Caption         =   "&System"
      Index           =   9
      Begin VB.Menu s 
         Caption         =   "&a.Login"
         Index           =   1
      End
      Begin VB.Menu s 
         Caption         =   "&b. Staff Maintenance"
         Index           =   2
      End
      Begin VB.Menu s 
         Caption         =   "&c. Change Password"
         Index           =   3
      End
      Begin VB.Menu s 
         Caption         =   "&d. Adminitrator"
         Index           =   4
      End
      Begin VB.Menu s 
         Caption         =   "&e. Exit Program"
         Index           =   5
      End
   End
End
Attribute VB_Name = "FrmMainMenu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub a_Click(Index As Integer)
Select Case Index
    
End Select
End Sub

Private Sub a1_Click(Index As Integer)
Select Case Index
    Case 1
        frmACR100.Show 1
    Case 2
        frmACR110.Show 1
End Select
End Sub

Private Sub a2_Click(Index As Integer)
Select Case Index
    Case 1
        frmACR105.Show 1
    Case 2
        frmACR115.Show 1
End Select
End Sub

Private Sub a4_Click(Index As Integer)
Select Case Index
    Case 1
        frmRAR500.Show 1
    Case 2
End Select
End Sub

Private Sub g1_Click(Index As Integer)
Select Case Index
    Case 1
    '    frmgld100.Show 1
    Case 2
    '    frmgld110.Show 1
    Case 3
    '    frmgld120.Show 1
    Case 4
    '    frmgld130.Show 1
    Case 5
    '    frmgld140.Show 1
    Case 6
        frmGLD150.Show 1
    Case 7
        frmGLD160.Show 1
End Select
End Sub

Private Sub i1_Click(Index As Integer)
Select Case Index
    Case 1
        frmINV100.Show 1
    Case 2
        frmINV110.Show 1
    Case 3
        frmINV120.Show 1
    Case 4
        frmINV130.Show 1
    Case 5
        frmINV140.Show 1
    Case 6
        frmINV150.Show 1
    Case 7
        frmINV160.Show 1
End Select

End Sub

Private Sub i2_Click(Index As Integer)
Select Case Index
    Case 1
        frmINV105.Show 1 'Item Master
    Case 2
        frmINV115.Show 1 'Warehouse
    Case 3
        frmINV125.Show 1 'Lot
    Case 4
        frmINV135.Show 1 'Type
    Case 5
        frmINV145.Show 1 'Class
    Case 6
        frmINV155.Show 1 'Unit Of Measurement
    Case 7
        frmINV165.Show 1 'Transaction Effect code
End Select
End Sub

Private Sub i3_Click(Index As Integer)
Reportflg = True

Select Case Index
    Case 1
        frmINV200.Show 1
    Case 2
        ReportName = "RECEIVE_DETAIL.rpt"
    Case 3
        ReportName = "ISSUED_DETAIL.rpt"
        
    Case 4
        ReportName = "stockmoment.rpt"
End Select
    If Index <> 1 And Index <> 4 Then
        FrmReportDateRange.Show 1
        If Reportflg = False Then
             Exit Sub
        End If
        CrystalReport1.ReportFileName = DDAN & "\" & ReportName
         CrystalReport1.RetrieveStoredProcParams
         CrystalReport1.StoredProcParam(0) = Format$(FrmReportDateRange.bdate, "mm/dd/yy")
         CrystalReport1.StoredProcParam(1) = Format$(FrmReportDateRange.edate, "mm/dd/yy")
         CrystalReport1.Action = 1
         Unload FrmReportDateRange
    ElseIf Index = 4 Then
        FrmReportDateRange.FrmeOption.Enabled = True
        FrmReportDateRange.Show 1
        
        If Reportflg = False Then
             Exit Sub
        End If
        CrystalReport1.ReportFileName = DDAN & "\" & ReportName
        CrystalReport1.RetrieveStoredProcParams
        CrystalReport1.StoredProcParam(0) = Format$(FrmReportDateRange.bdate, "mm/dd/yy")
        CrystalReport1.StoredProcParam(1) = Format$(FrmReportDateRange.edate, "mm/dd/yy")
        If FrmReportDateRange.Option1 = True Then
            CrystalReport1.StoredProcParam(2) = "0"
        ElseIf FrmReportDateRange.Option2 = True Then
            CrystalReport1.StoredProcParam(2) = "1"
        End If
        CrystalReport1.Action = 1
        Unload FrmReportDateRange
    End If
End Sub

Private Sub i4_Click(Index As Integer)
Select Case Index
    Case 1
        frmINV300.Show 1
End Select
End Sub

Private Sub i5_Click(Index As Integer)
Select Case Index
    Case 1
        frmINV500.Show 1
    Case 2
        frmINV540.Show 1
    Case 3
        FrmReceived.Show
End Select


End Sub

Private Sub i6_Click(Index As Integer)
Select Case Index
    Case 1 ' PeriodEndClosing
        INV900
    Case 2 ' Year End Closing
        INV910
End Select
End Sub

Private Sub Iv_Click(Index As Integer)
Select Case Index
    Case 1 ' BBL400 print invoice
        frmBBL400.Show 1
    Case 2 ' BBL410 Re-print invoice
        frmBBL410.Show 1
    Case 3
    Case 4
    Case 5 ' BBL 500 Invoice entry
        frmBBL500.Show 1
    Case 6
        'BBL510
        frmBBL_ConvOrdInv.Show 1
    Case 7
        frmregist.Show 1
End Select
End Sub

Private Sub l_Click(Index As Integer)
Select Case Index
    Case 1
        frmSAL100.Show 1
    Case 2
    
End Select
End Sub

Private Sub l2_Click(Index As Integer)
    Select Case Index
        Case 1
        frmSell.Show 1
    End Select
End Sub

Private Sub MDIForm_Activate()
Dim Old_User As String
Dim i As Long
Old_User = UserName
'If UserLogin = "" Then
'     UserName = FrmLogin.Tag
'End If
If UserName = "" Then
     UserName = FrmLogin.Tag
End If
Unload FrmLogin
If UserName <> "" And UserName <> Old_User Then
    Picture1.Visible = True
    SetMenuPad
    Picture1.Visible = False
Else
    If UserLogin = "" Then
        Unload FrmMainMenu
    End If
End If


End Sub

Private Sub MDIForm_Load()
BIENCHUNG
FrmLogin.Show 1
End Sub

Private Sub MDIForm_Unload(Cancel As Integer)
    If DBconn.State = adStateOpen Then
        DBconn.Close
        Unload Me
    Else
        Unload Me
    End If
    
End Sub

Private Sub o_Click(Index As Integer)
    Select Case Index
        
        Case 5
            frmORD500.Show 1
        Case 7
            frmORD540.Show 1
        Case 9
            frmORD560.Show 1
        Case 10
            FrmOrd600.Show 1
    End Select
End Sub

Private Sub o1_Click(Index As Integer)
Select Case Index
    Case 1
    Case 2
        frmORD110.Show 1
    Case 3
        frmORD120.Show 1
    Case 4
        frmORD130.Show 1
End Select
End Sub

Private Sub p_Click(Index As Integer)
Select Case Index
    Case 3
        frmPUR200.Show 1
    Case 4
        frmPUR210.Show 1
    Case 5
        frmPUR500.Show 1
    Case 6
        frmPUR510.Show 1
End Select
End Sub

Private Sub p1_Click(Index As Integer)
  Select Case Index
    Case 1
        FrmPOReport.Show 1
    Case 2
        frmPUR220.Show 1
    Case 3
        frmcust.Show 1
End Select
  
   
End Sub

Private Sub s_Click(Index As Integer)
Select Case Index
    Case 1
        FrmLogin.Show 1
    Case 2
        frmStaff.Show 1
    Case 3
        frmChangePassword.Show 1
    Case 4
        frmAdmin.Show 1
    Case 5
        DBconn.Close
        Unload FrmMainMenu
        End
End Select
End Sub

Private Sub y_Click(Index As Integer)
Select Case Index
    Case 1
        frmACP100.Show 1
    Case 2
End Select
End Sub
Sub SetMenuPad()
Dim RecMenuPad As Recordset
 Set RecMenuPad = DBconn.Execute("SELECT MenuPad.PadName,MenuPad.PadIndex" & _
                                " FROM MenuPad INNER JOIN" & _
                                " GroupFunction ON MenuPad.PadCode = GroupFunction.Padcode INNER JOIN" & _
                                " UserGroup ON GroupFunction.UserGroup = UserGroup.UserGroup" & _
                                " WHERE UserGroup.UserGroup <> '" & NhomLogin & "'")
'An nhung menu khong duoc phep
Do While Not RecMenuPad.EOF
        
        If InStr(1, RecMenuPad!PadName, "mn", 0) > 0 Then
            SetMenu_mn RecMenuPad!PadName, RecMenuPad!PadIndex, False
        Else
            If InStr(1, RecMenuPad!PadName, "i", 0) > 0 Then
                SetMenu_i RecMenuPad!PadName, RecMenuPad!PadIndex, False
            Else
                If InStr(1, RecMenuPad!PadName, "a", 0) > 0 Then
                    SetMenu_a RecMenuPad!PadName, RecMenuPad!PadIndex, False
                Else
                    If InStr(1, RecMenuPad!PadName, "p", 0) > 0 Then
                        SetMenu_p RecMenuPad!PadName, RecMenuPad!PadIndex, False
                    Else
                        If InStr(1, RecMenuPad!PadName, "o", 0) > 0 Then
                            SetMenu_o RecMenuPad!PadName, RecMenuPad!PadIndex, False
                        Else
                            If InStr(1, RecMenuPad!PadName, "iv", 0) > 0 Then
                                SetMenu_iv RecMenuPad!PadName, RecMenuPad!PadIndex, False
                            Else
                                If InStr(1, RecMenuPad!PadName, "l", 0) > 0 Then
                                    SetMenu_l RecMenuPad!PadName, RecMenuPad!PadIndex, False
                                Else
                                    If InStr(1, RecMenuPad!PadName, "y", 0) > 0 Then
                                        SetMenu_y RecMenuPad!PadName, RecMenuPad!PadIndex, False
                                    Else
                                        If InStr(1, RecMenuPad!PadName, "g", 0) > 0 Then
                                            SetMenu_g RecMenuPad!PadName, RecMenuPad!PadIndex, False
                                        Else
                                            If InStr(1, RecMenuPad!PadName, "s", 0) > 0 Then
                                                SetMenu_s RecMenuPad!PadName, RecMenuPad!PadIndex, False
                                            End If
                                        End If
                                    End If
                                End If
                            End If
                        End If
                    End If
                End If
            End If
        End If
    RecMenuPad.MoveNext

Loop
 
Set RecMenuPad = DBconn.Execute("SELECT MenuPad.PadName,MenuPad.PadIndex" & _
                                " FROM MenuPad INNER JOIN" & _
                                " GroupFunction ON MenuPad.PadCode = GroupFunction.Padcode INNER JOIN" & _
                                " UserGroup ON GroupFunction.UserGroup = UserGroup.UserGroup" & _
                                " WHERE UserGroup.UserGroup = '" & NhomLogin & "'")

Do While Not RecMenuPad.EOF 'SEt menu duoc phep
        If InStr(1, RecMenuPad!PadName, "mn", 0) > 0 Then
            SetMenu_mn RecMenuPad!PadName, RecMenuPad!PadIndex, True
        Else
            If InStr(1, RecMenuPad!PadName, "i", 0) > 0 Then
                SetMenu_i RecMenuPad!PadName, RecMenuPad!PadIndex, True
            Else
                If InStr(1, RecMenuPad!PadName, "a", 0) > 0 Then
                    SetMenu_a RecMenuPad!PadName, RecMenuPad!PadIndex, True
                Else
                    If InStr(1, RecMenuPad!PadName, "p", 0) > 0 Then
                        SetMenu_p RecMenuPad!PadName, RecMenuPad!PadIndex, True
                    Else
                        If InStr(1, RecMenuPad!PadName, "o", 0) > 0 Then
                            SetMenu_o RecMenuPad!PadName, RecMenuPad!PadIndex, True
                        Else
                            If InStr(1, RecMenuPad!PadName, "iv", 0) > 0 Then
                                SetMenu_iv RecMenuPad!PadName, RecMenuPad!PadIndex, True
                            Else
                                If InStr(1, RecMenuPad!PadName, "l", 0) > 0 Then
                                    SetMenu_l RecMenuPad!PadName, RecMenuPad!PadIndex, True
                                Else
                                    If InStr(1, RecMenuPad!PadName, "y", 0) > 0 Then
                                        SetMenu_y RecMenuPad!PadName, RecMenuPad!PadIndex, True
                                    Else
                                        If InStr(1, RecMenuPad!PadName, "g", 0) > 0 Then
                                            SetMenu_g RecMenuPad!PadName, RecMenuPad!PadIndex, True
                                        Else
                                            If InStr(1, RecMenuPad!PadName, "s", 0) > 0 Then
                                                SetMenu_s RecMenuPad!PadName, RecMenuPad!PadIndex, True
                                            End If
                                        End If
                                    End If
                                End If
                            End If
                        End If
                    End If
                End If
            End If
        End If
    RecMenuPad.MoveNext

Loop
RecMenuPad.Close
End Sub
Sub SetMenu_mn(PadName, PadIndex, Enable)
mn(PadIndex).Enabled = Enable

End Sub
Sub SetMenu_i(PadName, PadIndex, Enable)
Select Case PadName
    Case "i"
        i(PadIndex).Enabled = Enable
    Case "i1"
        i1(PadIndex).Enabled = Enable
    Case "i2"
        i2(PadIndex).Enabled = Enable
    Case "i3"
        i3(PadIndex).Enabled = Enable
    Case "i4"
        i4(PadIndex).Enabled = Enable
    Case "i5"
        i5(PadIndex).Enabled = Enable
    Case "i6"
        i6(PadIndex).Enabled = Enable
    
End Select


End Sub

Sub SetMenu_a(PadName, PadIndex, Enable)
Select Case PadName
    Case "a"
        a(PadIndex).Enabled = Enable
    Case "a1"
        a1(PadIndex).Enabled = Enable
    Case "a2"
        a2(PadIndex).Enabled = Enable
    Case "a3"
        a3(PadIndex).Enabled = Enable
    Case "a4"
        a4(PadIndex).Enabled = Enable
   ' Case "a5"
   '     a5(PadIndex).Enabled = enable
   ' Case "a6"
   '     a6(PadIndex).Enabled = enable
    
End Select


End Sub
Sub SetMenu_p(PadName, PadIndex, Enable)
Select Case PadName
    Case "p"
        p(PadIndex).Enabled = Enable
  
End Select


End Sub
Sub SetMenu_o(PadName, PadIndex, Enable)
Select Case PadName
    Case "o"
        o(PadIndex).Enabled = Enable
    Case "o1"
        o1(PadIndex).Enabled = Enable
    Case "o2"
        o2(PadIndex).Enabled = Enable
    Case "o3"
        o3(PadIndex).Enabled = Enable
   
End Select


End Sub
Sub SetMenu_iv(PadName, PadIndex, Enable)
Select Case PadName
    Case "iv"
        iv(PadIndex).Enabled = Enable
   
End Select


End Sub
Sub SetMenu_l(PadName, PadIndex, Enable)
Select Case PadName
    Case "l"
        l(PadIndex).Enabled = Enable
    Case "l2"
        l2(PadIndex).Enabled = Enable
 
End Select


End Sub
Sub SetMenu_y(PadName, PadIndex, Enable)
Select Case PadName
    Case "y"
        y(PadIndex).Enabled = Enable
    Case "y3"
        y3(PadIndex).Enabled = Enable
 
End Select


End Sub

Sub SetMenu_g(PadName, PadIndex, Enable)
Select Case PadName
    Case "g"
        g(PadIndex).Enabled = Enable
    Case "g1"
        g1(PadIndex).Enabled = Enable
    Case "g2"
        g2(PadIndex).Enabled = Enable
    Case "g3"
        g3(PadIndex).Enabled = Enable
    Case "g4"
        g4(PadIndex).Enabled = Enable
    Case "g5"
        g5(PadIndex).Enabled = Enable
    Case "g6"
        g6(PadIndex).Enabled = Enable
    
End Select


End Sub
Sub SetMenu_s(PadName, PadIndex, Enable)
Select Case PadName
    Case "s"
        s(PadIndex).Enabled = Enable
  
End Select


End Sub


Private Sub ScrStatus(formnme As String)
    Select Case formnme
        Case "ord500"
            frmORD500.lbl(33).Visible = False
            frmORD500.lbl(34).Visible = False
        Case "ord560"
            frmORD500.cmdReview.Visible = False
            frmORD500.cmdAddNew.Visible = False
            frmORD500.cmdNewItem.Visible = False
            frmORD500.cmdSave.Visible = False
            frmORD500.lbl(0).Visible = False
            frmORD500.lbl(1).Visible = False
    End Select
    

End Sub
